<%@page import="bean.MemberVo"%>
<%@page import="bean.MemberDTO"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>list.jsp</title>
<link rel='stylesheet' href='./css/member.css'/>
<script src='./js/member.js'></script>
</head>
<body>

<jsp:useBean id="vo" class="bean.MemberVo" scope="page"/>
<jsp:setProperty property="*" name="vo"/>
<%
MemberDTO dto = new MemberDTO();
dto.setVo(vo);
ArrayList<MemberVo> al = dto.select();

%>

<h1>회원 LIST</h1>
<input type='button' value='회원 입력' id='btnInput'/>
<div id='member_list_find'>

	<form name='memberFrm' method='post' id='memberFrm'
		  action='index.jsp?inc=./member/list.jsp'>
		<input type='text' name='find' value='<%=vo.getFind()%>'>
		<input type='hidden' name='nowPage' value='<%=vo.getNowPage() %>'>
		<input type='hidden' name='mid' value='<%=vo.getMid()%>'>
		<input type='submit' value='검색'>
	</form>
</div>

<div id='member_list_title'>
	<div class='member_list_mid'>아이디</div>
	<div class='member_list_irum'>성명</div>
	<div class='member_list_photo'>이미지</div>
</div>
<%for(int a=0; a<al.size() ;a++){ 
	MemberVo v = al.get(a);

%>

	<div class='member_list_items'>
		<div class='member_list_mid'>
			<a href='#' onclick="goView(<%=dto.getNowPage()%>,'<%=v.getMid() %>')">
				<%=v.getMid() %>
			</a>
		</div>
		<div class='member_list_irum'><%=v.getIrum() %></div>
		<div class='member_list_photo'><%=v.getPhoto() %></div>
	</div>

<%} %>

<div id='list_page'>
<% if(dto.getNowBlock() > 1){ %>
	<a href='#' onclick='goPage(1)'>맨첨</a>
	<a href='#' onclick='goPage(<%=dto.getStartPage()-1%>)'>이전</a> 
<%}
int i=0;
out.print("[");
for(i=dto.getStartPage(); i<=dto.getEndPage(); i++){%>
	<a href='#' onclick='goPage(<%=i%>)'> <%=i %> </a>
<%}
out.print("]");
if(dto.getNowBlock() < dto.getTotBlock()){ %>
<a href='#' onclick='goPage(<%=i%>)'>다음</a>
<a href='#' onclick='goPage(<%=dto.getTotPage()%>)'>맨끝</a>
<%} %>
</div>



<script>listInit();</script>

</body>
</html>
